
// Copyright (c) 2002 HTHK
package admin.system.role;

import com.ffpc.sql.*;

import admin.system.role.RoleBean;
/**
 * A Class class.
 * <P>
 * @author HTHK
 */
public class Role
  extends DataObject
  implements RoleBean
{
    private String role_id = null;
    private String role_name = null;
    private String role_des = null;
    private String crt_user = null;
    private String crt_date = null;
    private String upd_user = null;
    private String upd_date = null;
    private Column ColRole_id = null;
    private Column ColRole_name = null;
    private Column ColRole_des = null;
    private Column ColCrt_user = null;
    private Column ColCrt_date = null;
    private Column ColUpd_user = null;
    private Column ColUpd_date = null;
    /**
     * Constructor
     */
    public Role()
    {
        ColRole_id = new Column(0,"role_id",Column.Types.string,null,10,false);
        ColRole_name = new Column(1,"role_name",Column.Types.string,null,50,false);
        ColRole_des = new Column(2,"role_des",Column.Types.string,null,100,false);
        ColCrt_user = new Column(3,"crt_user",Column.Types.string,null,10,true);
        ColCrt_date = new Column(4,"crt_date",Column.Types.time,null,10,true);
        ColUpd_user = new Column(5,"upd_user",Column.Types.string,null,10,true);
        ColUpd_date = new Column(6,"upd_date",Column.Types.time,null,10,true);
    }

    // functions belongs to RoleBean interface

    @Override
	public void setRole_id(String role_id)
    {
        this.role_id = this.setAttribute(ColRole_id,role_id);
    }

    @Override
	public String getRole_id()
    {
        return this.role_id==null?"":this.role_id;
    }

    @Override
	public void setRole_name(String role_name)
    {
        this.role_name = this.setAttribute(ColRole_name,role_name);
    }

    @Override
	public String getRole_name()
    {
        return this.role_name==null?"":this.role_name;
    }

    @Override
	public void setRole_des(String role_des)
    {
        this.role_des = this.setAttribute(ColRole_des,role_des);
    }

    @Override
	public String getRole_des()
    {
        return this.role_des==null?"":this.role_des;
    }

    @Override
	public void setCrt_user(String crt_user)
    {
        this.crt_user = this.setAttribute(ColCrt_user,crt_user);
    }

    @Override
	public String getCrt_user()
    {
        return this.crt_user==null?"":this.crt_user;
    }

    @Override
	public void setCrt_date(String crt_date)
    {
        this.crt_date = this.setAttribute(ColCrt_date,crt_date);
    }

    @Override
	public String getCrt_date()
    {
        return this.crt_date==null?"":this.crt_date;
    }

    @Override
	public void setUpd_user(String upd_user)
    {
        this.upd_user = this.setAttribute(ColUpd_user,upd_user);
    }

    @Override
	public String getUpd_user()
    {
        return this.upd_user==null?"":this.upd_user;
    }

    @Override
	public void setUpd_date(String upd_date)
    {
        this.upd_date = this.setAttribute(ColUpd_date,upd_date);
    }

    @Override
	public String getUpd_date()
    {
        return this.upd_date==null?"":this.upd_date;
    }

    // belongs to row interface
    @Override
	public Column[] createColumns()
    {
        Column[] cols = new Column[7];
        cols[0] = ColRole_id.clone(null);
        cols[1] = ColRole_name.clone(null);
        cols[2] = ColRole_des.clone(null);
        cols[3] = ColCrt_user.clone(null);
        cols[4] = ColCrt_date.clone(null);
        cols[5] = ColUpd_user.clone(null);
        cols[6] = ColUpd_date.clone(null);
        return cols;
    }

    // super's abstract methods

    @Override
	public String getTableName()
    {
        return "jis.jis_s_role";
    }

    @Override
	protected String[] getKeyColumnNames()
    {
        String[] list = {"role_id"};
        return list;
    }

    @Override
	protected String[] getUpdatableColumnNames()
    {
        String[] list = {"role_name","role_des","crt_user","crt_date","upd_user","upd_date"};
        return list;
    }

    @Override
	protected void retrieveColumnValues()
    {
        this.role_id = this.retrieveColumnValue("role_id");
        this.role_name = this.retrieveColumnValue("role_name");
        this.role_des = this.retrieveColumnValue("role_des");
        this.crt_user = this.retrieveColumnValue("crt_user");
        this.crt_date = this.retrieveColumnValue("crt_date");
        this.upd_user = this.retrieveColumnValue("upd_user");
        this.upd_date = this.retrieveColumnValue("upd_date");
    }
}

